<template>
  <div id="message">
    <div>
    <div class="Breadcrumb">
      <Breadcrumb>
        <BreadcrumbItem to="/">首页</BreadcrumbItem>
        <BreadcrumbItem >消息列表</BreadcrumbItem>
        <BreadcrumbItem>留言板</BreadcrumbItem>
        <BreadcrumbItem v-if="!is_edit">留言详情</BreadcrumbItem>
      </Breadcrumb>
    </div>

    <Tabs type="card" v-show="is_edit">
      <TabPane label="留言板"><MessageAll></MessageAll></TabPane>
      <TabPane label="标签二">标签二的内容</TabPane>
      <TabPane label="标签三">标签三的内容</TabPane>
    </Tabs>
    </div>

    <router-view></router-view>
  </div>
</template>

<script>
import MessageAll from './messageItem/messageAll'
export default {
  name: "message",
  components:{
      MessageAll
  },
  data(){
    return{
      is_edit:true,
    }
  },
  created(){
    let path = this.$route.path
        if(path.indexOf('/message/Edit') != -1){
            this.is_edit = false
        }
  },
   beforeUpdate(){
        //更新状态前
        let path = this.$route.path
        if(path.indexOf('/message/Edit') != -1){
            this.is_edit = false
        }else if(path.indexOf('/Admin/message') !=-1){
            this.is_edit = true
        }
    }
}
</script>

<style lang='scss' scoped>
#message{
    padding: 15px;
    float:right;
    width: calc(100% - 350px);
    margin: 30px;
    margin-top: 110px;
    background: #F5F5FA;
    border-radius: 5px;
}
.Breadcrumb{
    background: #ffffff;
    line-height: 30px;
    margin-bottom: 20px;
}
</style>